package com.saydc.forms.capacitaciones;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class CapacitacionesNecesariasForm extends ActionForm {

	private static final long serialVersionUID = 1L;
	private int capacitacion;
	
	public int getCapacitacion() {
		return capacitacion;
	}
	public void setCapacitacion(int capacitacion) {
		this.capacitacion = capacitacion;
	}
	
	@Override
	public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if(capacitacion == -1){
			errors.add("capacitacionRequired", new ActionMessage("error.capacitacion.required"));
		}
		return errors;
	}
	

}
